﻿/*
 *  Utils.cs
 *
 *  Copyright (C) 2008 Dreamlusion <dreamlusion@gmail.com>
 *
 *      This program is free software; you can redistribute it and/or
 *      modify it under the terms of the GNU General Public License version
 *      2 as published by the Free Software Foundation.
 *
 */
using System;
using System.IO;
using System.Net;

namespace phpMyAdminToolkit.Common
{
	static class Utils
	{
		public static void CreatePathRecursive(string fullPath, bool isLastNodeFile)
		{
			string checkedPath = string.Empty;
			string[] splittedPath = fullPath.Split(new char[] { '\\', '/' });

			for (int i = 0; i < splittedPath.Length - 1; i++)
			{
				checkedPath += string.Concat(splittedPath[i], "\\");

				if (!Directory.Exists(checkedPath))
					Directory.CreateDirectory(checkedPath);
			}
		}
	}
}
